<table>
    <tr>
        <td class="grid_header"></td>
        <td class="grid_header">Segunda</td>
        <td class="grid_header">Terça</td>
        <td class="grid_header">Quarta</td>
        <td class="grid_header">Quinta</td>
        <td class="grid_header">Sexta</td>
        <td class="grid_header">Sabado</td>
        <td class="grid_header">Domingo</td>
    </tr>
    {foreach $grid as $time=>$week_days}
        <tr>
            <td class="grid_header">{$time}</td>
            {foreach $week_days as $week_day=>$class_infos}
                {if is_int($class_infos)}
                <td class="grid_infos" rowspan="{$class_infos}"></td>
                {/if}
                {if is_array($class_infos)}
                <td rowspan="{$class_infos['rowspan']}" class="grid_infos">
                    <a href="javascript:visualize_course({$class_infos['course_id']})">{$class_infos['course_title']}({$class_infos['course_code']})</a>:
                    <a href="javascript:visualize_class({$class_infos['class_id']})">{$class_infos['class_identification']}</a>
                </td>
                {/if}
             {/foreach}
        </tr>
    {/foreach}
</table>
 